package com.fansl.allround.study.designpattern.factory;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/10/11 16:37
 */
public class FactoryTest {
    public static void main(String[] args) {
         AnimalFarm horseFarm = new HorseFarm();
         for (int i=0;i<5;i++){
             Animal animal = horseFarm.newAnimal(i+"");
             animal.show();
         }
        AnimalFarm cattleFarm = new CattleFarm();
        for (int i=0;i<5;i++){
            Animal animal = cattleFarm.newAnimal(i+"");
            animal.show();
        }
    }
}
